package com.atguigu.controller;

import com.atguigu.pojo.User;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.*;

/**
 * projectName: com.atguigu.controller
 *
 * @author: 赵伟风
 * description:
 */
@Tag(name="用户模块接口集合")
@RestController
@RequestMapping("user")
public class UserController {

    //保存用户数据
    @Operation(summary = "保存用户接口")
    @PostMapping
    public User saveUser(@RequestBody @Parameter(description = "保存用户对象") User user){
        System.out.println("UserController.saveUser");
        System.out.println("user = " + user);
        return user;
    }
    @Operation(summary = "删除用户接口")
    //删除用户数据 id
    @DeleteMapping("/{id}")
    public User deleteUser(@PathVariable @Parameter(description = "指定删除id") int id){
        System.out.println("UserController.deleteUser");
        System.out.println("id = " + id);
        return null;
    }
}
